Example 8: Nested tables and an update
In this example a series of tasks is updated (based on the supplied IRN) in the
When a row is selected in the Tasks group of fields at the bottom of the module window, values in the fields above are updated. Assigned To: (Task Information) and Assigned By: (Task Information) are also tables - called nested tables in
The fields used are:
Fields |
Back-end name |
---|---|
IRN | irn
|
Description | TasDescription_tab
|
Assigned To | TasPersonAssignedToRef_nesttab
|
Assigned By | TasTaskAssignerRef_tab
|
Commencement Date | TasCommencementDate0
|
Notify | TasStartNotifyDate0
|
Completed | TasCompleted_tab
|
For display purposes only, the import data below is presented with column headings listed vertically rather than horizontally. The first row of any tab or comma delimited file must include the column names. The appropriate layout is:
irn
|
TasDescription_tab(1)
|
TasDescription_tab(2)
|
TasDescription_tab(3)
|
11
|
Check the event dates are available. | Organise a committee to overlook the event development. | Confirm that all works are available for exhibiting. |
The import data is:
Column Name (must appear as the first row of the import data file) |
Description |
Record 1 |
---|---|---|
irn
|
|
11
|
TasDescription_tab(1)
|
Specifies a value for Description in the first row in the Tasks table. |
Check the event dates are available. |
TasDescription_tab(2)
|
Specifies a value for Description in the second row in the Tasks table. |
Organise a committee to overlook the event development. |
TasDescription_tab(3)
|
|
Confirm that all works are available for exhibiting. |
TasDescription_tab(4)
|
|
Talk to finance department about funding. |
TasPersonAssignedToRef_nesttab(1:1).NamFirst
|
Assigned To: (Task Information) is a nested table, essentially a table within a table (the Tasks table in this case). The first The second This is also an attachment field and specifies the First: (Person Details) field in the Parties module. |
Joe
|
TasPersonAssignedToRef_nesttab(1:1).NamLast
|
Assigned To: (Task Information) is a nested table, essentially a table within a table (the Tasks table in this case). The first The second This is an attachment field too and specifies the Last: (Person Details) field in the Parties module. |
Jackson
|
TasPersonAssignedToRef_nesttab(1:2).NamFirst
|
|
Jim
|
TasPersonAssignedToRef_nesttab(1:2).NamLast
|
|
Johnson
|
TasPersonAssignedToRef_nesttab(2:1).NamFirst
|
Next we move to the second row in the Tasks table, indicated by the The This is an attachment field too and specifies the First: (Person Details) field in the Parties module. |
Joe
|
TasPersonAssignedToRef_nesttab(2:1).NamLast
|
|
Jackson
|
TasPersonAssignedToRef_nesttab(2:2).NamFirst
|
|
Jim
|
TasPersonAssignedToRef_nesttab(2:2).NamLast
|
|
Johnson
|
TasPersonAssignedToRef_nesttab(2:3).NamFirst
|
|
Paul
|
TasPersonAssignedToRef_nesttab(2:3).NamLast
|
|
smith
|
TasPersonAssignedToRef_nesttab(3:1).NamFirst
|
|
Paul
|
TasPersonAssignedToRef_nesttab(3:1).NamLast
|
|
smith
|
TasPersonAssignedToRef_nesttab(4:1).NamFirst
|
|
Jim
|
TasPersonAssignedToRef_nesttab(4:1).NamLast
|
|
Johnson
|
TasTaskAssignerRef_tab(1).NamFirst
|
|
Rachael
|
TasTaskAssignerRef_tab(1).NamLast
|
|
Albost
|
TasTaskAssignerRef_tab(2).NamFirst
|
|
Rachael
|
TasTaskAssignerRef_tab(2).NamLast
|
|
Albost
|
TasTaskAssignerRef_tab(3).NamFirst
|
|
Rachael
|
TasTaskAssignerRef_tab(3).NamLast
|
|
Albost
|
TasTaskAssignerRef_tab(4).NamFirst
|
|
Rachael
|
TasTaskAssignerRef_tab(4).NamLast
|
|
Albost
|
TasCommencementDate0(1)
|
|
23-Mar-04 |
TasCommencementDate0(2)
|
|
30-Mar-04 |
TasCommencementDate0(3)
|
|
10-Apr-04 |
TasCommencementDate0(4)
|
|
14-Apr-04 |
TasStartNotifyDate0(1)
|
|
14-Mar-04 |
TasStartNotifyDate0(2)
|
|
23-Mar-04 |
TasStartNotifyDate0(3)
|
|
3-Apr-04 |
TasStartNotifyDate0(4)
|
|
7-Apr-04 |
TasCompleted_tab(1)
|
|
No |
TasCompleted_tab(2)
|
|
No |
TasCompleted_tab(3)
|
|
No |
TasCompleted_tab(4)
|
|
No |
The XML for this example is:
<?xml version="1.0" encoding="UTF-8"?>
<table>
<!--First record -->
<tuple>
<atom name="irn">11</atom>
<!--Four rows (tuples) in the Tasks group of fields are specified. This is the outer level of the nested table pair. For each tuple specified here there will be a tuple in the inner table specified next-->
<table name="TasDescription_tab">
<tuple>
<atom>Check the event dates are available.</atom>
</tuple>
<tuple>
<atom>Organise a committee to overlook the event development.</atom>
</tuple>
<tuple>
<atom>Confirm that all works are available for exhibiting.</atom>
</tuple>
<tuple>
<atom>Talk to finance department about funding.</atom>
</tuple>
</table>
<!--The inner table of the nested table pair is specified-->
<table name="TasPersonAssignedToRef_nesttab">
<!--The first tuple corresponds to the first tuple specified in the outer level table above. There are two rows specified-->
<tuple>
<table>
<tuple>
<atom name="NamFirst">Joe</atom>
<atom name="NamLast">Jackson</atom>
</tuple>
<tuple>
<atom name="NamFirst">Jim</atom>
<atom name="NamLast">Johnson</atom>
</tuple>
</table>
</tuple>
<!--The second tuple corresponds to the second tuple specified in the outer level table above. There are three rows specified. And so on-->
<tuple>
<table>
<tuple>
<atom name="NamFirst">Joe</atom>
<atom name="NamLast">Jackson</atom>
</tuple>
<tuple>
<atom name="NamFirst">Jim</atom>
<atom name="NamLast">Johnson</atom>
</tuple>
<tuple>
<atom name="NamFirst">Paul</atom>
<atom name="NamLast">Smith</atom>
</tuple>
</table>
</tuple>
<tuple>
<table>
<tuple>
<atom name="NamFirst">Paul</atom>
<atom name="NamLast">Smith</atom>
</tuple>
</table>
</tuple>
<tuple>
<table>
<tuple>
<atom name="NamFirst">Jim</atom>
<atom name="NamLast">Johnson</atom>
</tuple>
</table>
</tuple>
</table>
<table name="TasTaskAssignerRef_tab">
<tuple>
<atom name="NamFirst">Rachael</atom>
<atom name="NamLast">Albost</atom>
</tuple>
<tuple>
<atom name="NamFirst">Rachael</atom>
<atom name="NamLast">Albost</atom>
</tuple>
<tuple>
<atom name="NamFirst">Rachael</atom>
<atom name="NamLast">Albost</atom>
</tuple>
<tuple>
<atom name="NamFirst">Rachael</atom>
<atom name="NamLast">Albost</atom>
</tuple>
</table>
<table name="TasCommencementDate0">
<tuple>
<atom>23 March 2004</atom>
</tuple>
<tuple>
<atom>30 March 2004</atom>
</tuple>
<tuple>
<atom>10 April 2004</atom>
</tuple>
<tuple>
<atom>14 April 2004</atom>
</tuple>
</table>
<table name="TasStartNotifyDate0">
<tuple>
<atom>14 March 2004</atom>
</tuple>
<tuple>
<atom>23 March 2004</atom>
</tuple>
<tuple>
<atom>3 April 2004</atom>
</tuple>
<tuple>
<atom>7 April 2004</atom>
</tuple>
</table>
<table name="TasCompleted_tab">
<tuple>
<atom>No</atom>
</tuple>
<tuple>
<atom>No</atom>
</tuple>
<tuple>
<atom>No</atom>
</tuple>
<tuple>
<atom>No</atom>
</tuple>
</table>
</tuple>
</table>